import * as types from "./type";
import {saleAlsApi, getPlatfromList} from '@/api';

export default {
  [types.SOME_MUTATION](context) {

  },
  [types.SALE_ALS_TABLE_DATA](context, payload) {
    return saleAlsApi(payload).then(({data}) => {
      context.commit('setSaleAlsTableData', data)
    });
  },
  async [types.GET_PARAMS_TO_REQUEST_SALE_TABLE]({dispatch, commit}, payload) {
    await dispatch(types.SALE_ALS_TABLE_DATA, payload.params);
  },
  [types.GET_ALL_PLATFORMLIST_DATA](context, payload) {
    return getPlatfromList(payload).then(({data}) => {
      context.commit('setAllPlatfromSelect', data)
    });
  },
  async [types.GET_ALL_PLATFORMLIST_PARAMS]({dispatch, commit}, payload) {
    await dispatch(types.GET_ALL_PLATFORMLIST_DATA, payload.params);
  },
}
